String.prototype.endWith=function(s){//重新endWith方法
	if(s==null||s==""||this.length==0||s.length>this.length)
		return false;
	if(this.substring(this.length-s.length)==s)
		return true;
	else
		return false;
	return true;
}
String.prototype.startWith=function(s){//重写startWith方法
	if(s==null||s==""||this.length==0||s.length>this.length)
		return false;
	if(this.substr(0,s.length)==s)
		return true;
	else
		return false;
	return true;
}
require.config({
	baseUrl: ctx + '/scripts/app',
    paths: {
        'jQuery' : '../third/jquery-1.11.3.min',
        'jqueryBackground': '../third/jquery.particleground.min',
        'common': '../common/common',
        'layui': '../../plugins/layui/layui',
        'layer': '../../plugins/layui/lay/modules/layer',
        'validateForm': '../common/validateForm',
        'md5': '../third/md5',
        'login': 'login',
        'index': 'index',
        'list' : 'list',
        'layerConfig' : '../common/layui-plugins/layerconfig',
        'ztreeJquery': '../../plugins/zTree-3.5.12/js/jquery-1.4.4.min',
        'ztreeAll': '../../plugins/zTree-3.5.12/js/jquery.ztree.all-3.5.min',
        'ztree': '../common/ztree',
        'defineTree': '../common/defineTree',
        'pinyin': '../common/PinyinFilter',
        'template': '../../plugins/art-template/template'
    },
    map: {
        '*': {
            'css': '../third/css'
        }
    },
    /**
     * shim 参数值： deps 指定依赖，  exports: 非AMD模块规范的js加载
     * deps在调用时候每个模块自己指定
     * 
     **/
    shim: {
    	'jQuery' : {
    		exports : '$'
    	},
    	'layer' : {
    		deps : ['css!../../plugins/layui/css/modules/layer/default/layer.css']
    	},
    	'common' : {
    		exports : 'Common'
    	},
    	'validateForm' : {
    		deps : ['jQuery'],
    		exports : 'validateForm'
    	},
    	'login' : {
    		deps : ['jQuery', 'md5', 'common', 'css!../../plugins/layui/css/layui.css', 'css!../../styles/login.css']
    	},
    	'index' : {
    		deps : ['css!../../plugins/layui/css/layui.css', 'css!../../styles/global.css', 'css!../../styles/index.css', 'css!../../plugins/font-awesome/css/font-awesome.min.css', 'css!../../styles/reset.css']
    	},
    	'list' : {
    		deps : ['css!../../plugins/layui/css/layui.css', 'css!../../styles/common.css', 'css!../../styles/global.css', 'css!../../styles/reset.css']
    	},
    	'defineTree': {
    		deps : ['ztreeJquery', 'ztreeAll', 'pinyin', 'ztree', 'css!../../plugins/zTree-3.5.12/css/zTreeStyle/zTreeStyle.css'],
    		exports : 'defineTree'
    	},
    	'ztreeAll' : {
    		deps : ['ztreeJquery']
    	},
    	'template' : {
    		deps : [],
    		exports : 'template' 
    	}
    }
});